package com.huahua.myIdea.service.serviceImpl;

import com.huahua.myIdea.service.MyService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;

@Service
public class MyServiceImpl implements MyService, InitializingBean {

    @Override
    public int addTotal(int x, int y) {
        return 0;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("开始执行 afterPropertiesSet 方法: MyServiceImpl");
    }

    @PostConstruct
    public void postConstructMethod() {
        System.out.println("开始执行 PostConstruct 方法: MyServiceImpl");
    }

    @Autowired
    private void testAutowired(){
        System.out.println("开始执行 testAutowired 方法: MyServiceImpl");
    }

    MyServiceImpl(){
        System.out.println("开始执行 构造函数MyServiceImpl : MyServiceImpl");
    }
}
